package cn.kgc.itrip.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
@ComponentScan({"cn.kgc.itrip.controller"})
public class SwaggerConfig {

    @Bean
    public Docket docket(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        docket.apiInfo(apiInfo());
        return docket;
    }


    @Bean
    public ApiInfo apiInfo(){
        return new ApiInfo("爱旅行项目","旅行的网站",
                "2.0", "www.baidu.com",
                "张三",
                "授权来源","www.163.com");
    }

}
